<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="姓名" prop="username">
        <el-input
          v-model="queryParams.username"
          placeholder="请输入姓名"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="证件编号" prop="certificateId">
        <el-input
          v-model="queryParams.certificateId"
          placeholder="请输入证件编号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="身份证号" prop="idNumber">
        <el-input
          v-model="queryParams.idNumber"
          placeholder="请输入身份证号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="部门" prop="deptid">
        <el-input
          v-model="queryParams.deptid"
          placeholder="请输入部门"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="用户ID" prop="userId">
        <el-input
          v-model="queryParams.userId"
          placeholder="请输入用户ID"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="部门ID" prop="deptId">
        <el-input
          v-model="queryParams.deptId"
          placeholder="请输入部门ID"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="单位" prop="department">
        <el-input
          v-model="queryParams.department"
          placeholder="请输入单位"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="承办人" prop="undertaker">
        <el-input
          v-model="queryParams.undertaker"
          placeholder="请输入承办人"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="电话" prop="phone">
        <el-input
          v-model="queryParams.phone"
          placeholder="请输入电话"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="来源" prop="equipSource">
        <el-input
          v-model="queryParams.equipSource"
          placeholder="请输入来源"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="编号" prop="serialNumber">
        <el-input
          v-model="queryParams.serialNumber"
          placeholder="请输入编号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="M级" prop="equipSecurity">
        <el-input
          v-model="queryParams.equipSecurity"
          placeholder="请输入M级"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="启用时间" prop="activeTime">
        <el-input
          v-model="queryParams.activeTime"
          placeholder="请输入启用时间"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="硬件编码" prop="hardwareCode">
        <el-input
          v-model="queryParams.hardwareCode"
          placeholder="请输入硬件编码"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="硬盘序列号" prop="identificationOfHardDisk">
        <el-input
          v-model="queryParams.identificationOfHardDisk"
          placeholder="请输入硬盘序列号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="安全BM防护系统安装情况" prop="installation">
        <el-input
          v-model="queryParams.installation"
          placeholder="请输入安全BM防护系统安装情况"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="主要通途" prop="mainThoroughfare">
        <el-input
          v-model="queryParams.mainThoroughfare"
          placeholder="请输入主要通途"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="备注" prop="note">
        <el-input
          v-model="queryParams.note"
          placeholder="请输入备注"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="序号" prop="sequenceNumber">
        <el-input
          v-model="queryParams.sequenceNumber"
          placeholder="请输入序号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="责任人" prop="dutyOfficer">
        <el-input
          v-model="queryParams.dutyOfficer"
          placeholder="请输入责任人"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="责任开始时间" prop="dutyStartTime">
        <el-date-picker clearable
          v-model="queryParams.dutyStartTime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择责任开始时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="责任结束时间" prop="dutyEndTime">
        <el-date-picker clearable
          v-model="queryParams.dutyEndTime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择责任结束时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="审批领导(责任人变更登记)" prop="changeLeadership">
        <el-input
          v-model="queryParams.changeLeadership"
          placeholder="请输入审批领导(责任人变更登记)"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="日期" prop="changeDate">
        <el-date-picker clearable
          v-model="queryParams.changeDate"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择日期">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="故障原因" prop="faultCause">
        <el-input
          v-model="queryParams.faultCause"
          placeholder="请输入故障原因"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="报修人" prop="repairMan">
        <el-input
          v-model="queryParams.repairMan"
          placeholder="请输入报修人"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="处理结果" prop="handlingResult">
        <el-input
          v-model="queryParams.handlingResult"
          placeholder="请输入处理结果"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="经办人" prop="operator">
        <el-input
          v-model="queryParams.operator"
          placeholder="请输入经办人"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="审批领导(故障维修登记)" prop="maintainLeadership">
        <el-input
          v-model="queryParams.maintainLeadership"
          placeholder="请输入审批领导(故障维修登记)"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="报废日期" prop="retirementTime">
        <el-date-picker clearable
          v-model="queryParams.retirementTime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择报废日期">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="责任人意见" prop="dutyOfficerOpinion">
        <el-input
          v-model="queryParams.dutyOfficerOpinion"
          placeholder="请输入责任人意见"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="审批领导建议" prop="leadershipSuggestions">
        <el-input
          v-model="queryParams.leadershipSuggestions"
          placeholder="请输入审批领导建议"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="存放地点" prop="storagePlace">
        <el-input
          v-model="queryParams.storagePlace"
          placeholder="请输入存放地点"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="管理人" prop="custodian">
        <el-input
          v-model="queryParams.custodian"
          placeholder="请输入管理人"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="送销地点" prop="sendLocation">
        <el-input
          v-model="queryParams.sendLocation"
          placeholder="请输入送销地点"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="送销日期" prop="sendDate">
        <el-date-picker clearable
          v-model="queryParams.sendDate"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择送销日期">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="送销人" prop="sendPeople">
        <el-input
          v-model="queryParams.sendPeople"
          placeholder="请输入送销人"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="监销人" prop="salePeople">
        <el-input
          v-model="queryParams.salePeople"
          placeholder="请输入监销人"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="创建者" prop="createBy">
        <el-input
          v-model="queryParams.createBy"
          placeholder="请输入创建者"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="创建时间" prop="createTime">
        <el-date-picker clearable
          v-model="queryParams.createTime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择创建时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="更新者" prop="updateBy">
        <el-input
          v-model="queryParams.updateBy"
          placeholder="请输入更新者"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="更新时间" prop="updateTime">
        <el-date-picker clearable
          v-model="queryParams.updateTime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择更新时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['system:archives:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['system:archives:edit']"
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['system:archives:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['system:archives:export']"
        >导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="archivesList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="ID" align="center" prop="id" />
      <el-table-column label="姓名" align="center" prop="username" />
      <el-table-column label="证件编号" align="center" prop="certificateId" />
      <el-table-column label="身份证号" align="center" prop="idNumber" />
      <el-table-column label="部门" align="center" prop="deptid" />
      <el-table-column label="用户ID" align="center" prop="userId" />
      <el-table-column label="部门ID" align="center" prop="deptId" />
      <el-table-column label="单位" align="center" prop="department" />
      <el-table-column label="承办人" align="center" prop="undertaker" />
      <el-table-column label="电话" align="center" prop="phone" />
      <el-table-column label="类型" align="center" prop="equipType" />
      <el-table-column label="来源" align="center" prop="equipSource" />
      <el-table-column label="编号" align="center" prop="serialNumber" />
      <el-table-column label="M级" align="center" prop="equipSecurity" />
      <el-table-column label="启用时间" align="center" prop="activeTime" />
      <el-table-column label="品牌类型" align="center" prop="brandType" />
      <el-table-column label="硬件编码" align="center" prop="hardwareCode" />
      <el-table-column label="硬盘序列号" align="center" prop="identificationOfHardDisk" />
      <el-table-column label="安全BM防护系统安装情况" align="center" prop="installation" />
      <el-table-column label="主要通途" align="center" prop="mainThoroughfare" />
      <el-table-column label="备注" align="center" prop="note" />
      <el-table-column label="序号" align="center" prop="sequenceNumber" />
      <el-table-column label="责任人" align="center" prop="dutyOfficer" />
      <el-table-column label="责任开始时间" align="center" prop="dutyStartTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.dutyStartTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="责任结束时间" align="center" prop="dutyEndTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.dutyEndTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="审批领导(责任人变更登记)" align="center" prop="changeLeadership" />
      <el-table-column label="日期" align="center" prop="changeDate" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.changeDate, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="故障原因" align="center" prop="faultCause" />
      <el-table-column label="报修人" align="center" prop="repairMan" />
      <el-table-column label="处理结果" align="center" prop="handlingResult" />
      <el-table-column label="经办人" align="center" prop="operator" />
      <el-table-column label="审批领导(故障维修登记)" align="center" prop="maintainLeadership" />
      <el-table-column label="报废原因" align="center" prop="discardReason" />
      <el-table-column label="报废日期" align="center" prop="retirementTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.retirementTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="责任人意见" align="center" prop="dutyOfficerOpinion" />
      <el-table-column label="审批领导建议" align="center" prop="leadershipSuggestions" />
      <el-table-column label="存放地点" align="center" prop="storagePlace" />
      <el-table-column label="管理人" align="center" prop="custodian" />
      <el-table-column label="送销地点" align="center" prop="sendLocation" />
      <el-table-column label="送销日期" align="center" prop="sendDate" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.sendDate, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="送销人" align="center" prop="sendPeople" />
      <el-table-column label="监销人" align="center" prop="salePeople" />
      <el-table-column label="创建者" align="center" prop="createBy" />
      <el-table-column label="创建时间" align="center" prop="createTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="更新者" align="center" prop="updateBy" />
      <el-table-column label="更新时间" align="center" prop="updateTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="备注" align="center" prop="remark" />
      <el-table-column label="备注1" align="center" prop="note1" />
      <el-table-column label="备注2" align="center" prop="note2" />
      <el-table-column label="备注3" align="center" prop="note3" />
      <el-table-column label="备注4" align="center" prop="note4" />
      <el-table-column label="备注5" align="center" prop="note5" />
      <el-table-column label="备注6" align="center" prop="note6" />
      <el-table-column label="备注7" align="center" prop="note7" />
      <el-table-column label="备注8" align="center" prop="note8" />
      <el-table-column label="备注9" align="center" prop="note9" />
      <el-table-column label="备注10" align="center" prop="note10" />
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['system:archives:edit']"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['system:archives:remove']"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    
    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改办公设备对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="姓名" prop="username">
          <el-input v-model="form.username" placeholder="请输入姓名" />
        </el-form-item>
        <el-form-item label="证件编号" prop="certificateId">
          <el-input v-model="form.certificateId" placeholder="请输入证件编号" />
        </el-form-item>
        <el-form-item label="身份证号" prop="idNumber">
          <el-input v-model="form.idNumber" placeholder="请输入身份证号" />
        </el-form-item>
        <el-form-item label="部门" prop="deptid">
          <el-input v-model="form.deptid" placeholder="请输入部门" />
        </el-form-item>
        <el-form-item label="用户ID" prop="userId">
          <el-input v-model="form.userId" placeholder="请输入用户ID" />
        </el-form-item>
        <el-form-item label="部门ID" prop="deptId">
          <el-input v-model="form.deptId" placeholder="请输入部门ID" />
        </el-form-item>
        <el-form-item label="单位" prop="department">
          <el-input v-model="form.department" placeholder="请输入单位" />
        </el-form-item>
        <el-form-item label="承办人" prop="undertaker">
          <el-input v-model="form.undertaker" placeholder="请输入承办人" />
        </el-form-item>
        <el-form-item label="电话" prop="phone">
          <el-input v-model="form.phone" placeholder="请输入电话" />
        </el-form-item>
        <el-form-item label="来源" prop="equipSource">
          <el-input v-model="form.equipSource" placeholder="请输入来源" />
        </el-form-item>
        <el-form-item label="编号" prop="serialNumber">
          <el-input v-model="form.serialNumber" placeholder="请输入编号" />
        </el-form-item>
        <el-form-item label="M级" prop="equipSecurity">
          <el-input v-model="form.equipSecurity" placeholder="请输入M级" />
        </el-form-item>
        <el-form-item label="启用时间" prop="activeTime">
          <el-input v-model="form.activeTime" placeholder="请输入启用时间" />
        </el-form-item>
        <el-form-item label="硬件编码" prop="hardwareCode">
          <el-input v-model="form.hardwareCode" placeholder="请输入硬件编码" />
        </el-form-item>
        <el-form-item label="硬盘序列号" prop="identificationOfHardDisk">
          <el-input v-model="form.identificationOfHardDisk" placeholder="请输入硬盘序列号" />
        </el-form-item>
        <el-form-item label="安全BM防护系统安装情况" prop="installation">
          <el-input v-model="form.installation" placeholder="请输入安全BM防护系统安装情况" />
        </el-form-item>
        <el-form-item label="主要通途" prop="mainThoroughfare">
          <el-input v-model="form.mainThoroughfare" placeholder="请输入主要通途" />
        </el-form-item>
        <el-form-item label="备注" prop="note">
          <el-input v-model="form.note" placeholder="请输入备注" />
        </el-form-item>
        <el-form-item label="序号" prop="sequenceNumber">
          <el-input v-model="form.sequenceNumber" placeholder="请输入序号" />
        </el-form-item>
        <el-form-item label="责任人" prop="dutyOfficer">
          <el-input v-model="form.dutyOfficer" placeholder="请输入责任人" />
        </el-form-item>
        <el-form-item label="责任开始时间" prop="dutyStartTime">
          <el-date-picker clearable
            v-model="form.dutyStartTime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择责任开始时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="责任结束时间" prop="dutyEndTime">
          <el-date-picker clearable
            v-model="form.dutyEndTime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择责任结束时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="审批领导(责任人变更登记)" prop="changeLeadership">
          <el-input v-model="form.changeLeadership" placeholder="请输入审批领导(责任人变更登记)" />
        </el-form-item>
        <el-form-item label="日期" prop="changeDate">
          <el-date-picker clearable
            v-model="form.changeDate"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择日期">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="故障原因" prop="faultCause">
          <el-input v-model="form.faultCause" placeholder="请输入故障原因" />
        </el-form-item>
        <el-form-item label="报修人" prop="repairMan">
          <el-input v-model="form.repairMan" placeholder="请输入报修人" />
        </el-form-item>
        <el-form-item label="处理结果" prop="handlingResult">
          <el-input v-model="form.handlingResult" placeholder="请输入处理结果" />
        </el-form-item>
        <el-form-item label="经办人" prop="operator">
          <el-input v-model="form.operator" placeholder="请输入经办人" />
        </el-form-item>
        <el-form-item label="审批领导(故障维修登记)" prop="maintainLeadership">
          <el-input v-model="form.maintainLeadership" placeholder="请输入审批领导(故障维修登记)" />
        </el-form-item>
        <el-form-item label="报废原因" prop="discardReason">
          <el-input v-model="form.discardReason" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="报废日期" prop="retirementTime">
          <el-date-picker clearable
            v-model="form.retirementTime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择报废日期">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="责任人意见" prop="dutyOfficerOpinion">
          <el-input v-model="form.dutyOfficerOpinion" placeholder="请输入责任人意见" />
        </el-form-item>
        <el-form-item label="审批领导建议" prop="leadershipSuggestions">
          <el-input v-model="form.leadershipSuggestions" placeholder="请输入审批领导建议" />
        </el-form-item>
        <el-form-item label="存放地点" prop="storagePlace">
          <el-input v-model="form.storagePlace" placeholder="请输入存放地点" />
        </el-form-item>
        <el-form-item label="管理人" prop="custodian">
          <el-input v-model="form.custodian" placeholder="请输入管理人" />
        </el-form-item>
        <el-form-item label="送销地点" prop="sendLocation">
          <el-input v-model="form.sendLocation" placeholder="请输入送销地点" />
        </el-form-item>
        <el-form-item label="送销日期" prop="sendDate">
          <el-date-picker clearable
            v-model="form.sendDate"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择送销日期">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="送销人" prop="sendPeople">
          <el-input v-model="form.sendPeople" placeholder="请输入送销人" />
        </el-form-item>
        <el-form-item label="监销人" prop="salePeople">
          <el-input v-model="form.salePeople" placeholder="请输入监销人" />
        </el-form-item>
        <el-form-item label="备注" prop="remark">
          <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="备注1" prop="note1">
          <el-input v-model="form.note1" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="备注2" prop="note2">
          <el-input v-model="form.note2" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="备注3" prop="note3">
          <el-input v-model="form.note3" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="备注4" prop="note4">
          <el-input v-model="form.note4" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="备注5" prop="note5">
          <el-input v-model="form.note5" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="备注6" prop="note6">
          <el-input v-model="form.note6" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="备注7" prop="note7">
          <el-input v-model="form.note7" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="备注8" prop="note8">
          <el-input v-model="form.note8" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="备注9" prop="note9">
          <el-input v-model="form.note9" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="备注10" prop="note10">
          <el-input v-model="form.note10" type="textarea" placeholder="请输入内容" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { listArchives, getArchives, delArchives, addArchives, updateArchives } from "@/api/system/archives";

export default {
  name: "Archives",
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 办公设备表格数据
      archivesList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        username: null,
        certificateId: null,
        idNumber: null,
        deptid: null,
        userId: null,
        deptId: null,
        department: null,
        undertaker: null,
        phone: null,
        equipType: null,
        equipSource: null,
        serialNumber: null,
        equipSecurity: null,
        activeTime: null,
        brandType: null,
        hardwareCode: null,
        identificationOfHardDisk: null,
        installation: null,
        mainThoroughfare: null,
        note: null,
        sequenceNumber: null,
        dutyOfficer: null,
        dutyStartTime: null,
        dutyEndTime: null,
        changeLeadership: null,
        changeDate: null,
        faultCause: null,
        repairMan: null,
        handlingResult: null,
        operator: null,
        maintainLeadership: null,
        discardReason: null,
        retirementTime: null,
        dutyOfficerOpinion: null,
        leadershipSuggestions: null,
        storagePlace: null,
        custodian: null,
        sendLocation: null,
        sendDate: null,
        sendPeople: null,
        salePeople: null,
        createBy: null,
        createTime: null,
        updateBy: null,
        updateTime: null,
        remark: null,
        note1: null,
        note2: null,
        note3: null,
        note4: null,
        note5: null,
        note6: null,
        note7: null,
        note8: null,
        note9: null,
        note10: null
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
      }
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询办公设备列表 */
    getList() {
      this.loading = true;
      listArchives(this.queryParams).then(response => {
        this.archivesList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        id: null,
        username: null,
        certificateId: null,
        idNumber: null,
        deptid: null,
        userId: null,
        deptId: null,
        department: null,
        undertaker: null,
        phone: null,
        equipType: null,
        equipSource: null,
        serialNumber: null,
        equipSecurity: null,
        activeTime: null,
        brandType: null,
        hardwareCode: null,
        identificationOfHardDisk: null,
        installation: null,
        mainThoroughfare: null,
        note: null,
        sequenceNumber: null,
        dutyOfficer: null,
        dutyStartTime: null,
        dutyEndTime: null,
        changeLeadership: null,
        changeDate: null,
        faultCause: null,
        repairMan: null,
        handlingResult: null,
        operator: null,
        maintainLeadership: null,
        discardReason: null,
        retirementTime: null,
        dutyOfficerOpinion: null,
        leadershipSuggestions: null,
        storagePlace: null,
        custodian: null,
        sendLocation: null,
        sendDate: null,
        sendPeople: null,
        salePeople: null,
        createBy: null,
        createTime: null,
        updateBy: null,
        updateTime: null,
        remark: null,
        note1: null,
        note2: null,
        note3: null,
        note4: null,
        note5: null,
        note6: null,
        note7: null,
        note8: null,
        note9: null,
        note10: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加办公设备";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const id = row.id || this.ids
      getArchives(id).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改办公设备";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.id != null) {
            updateArchives(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addArchives(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$modal.confirm('是否确认删除办公设备编号为"' + ids + '"的数据项？').then(function() {
        return delArchives(ids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('system/archives/export', {
        ...this.queryParams
      }, `archives_${new Date().getTime()}.xlsx`)
    }
  }
};
</script>
